/*
 * @Author: 码上talk|RC
 * @Date: 2021-08-17 09:57:55
 * @LastEditTime: 2022-03-03 15:44:30
 * @LastEditors: 码上talk|RC
 * @Description:
 * @FilePath: /ma-distributor/config/app.js
 * @微信:  13680065830
 * @邮箱:  3189482282@qq.com
 * @oops: Just do what I think it is right
 */

const APP_ENV = 'dev';

export const appConfig = {
  APP_ENV,
  wx: {
    appid: 'wx8a661b1b75f66322'
  },
  tokenKey: 'user-access-token',
  localVersionKey: 'local-version',
  historySearchKey: 'local-history-search',
  staticUrl: 'https://aoxqwl-static.oss-cn-shenzhen.aliyuncs.com/image/ma-distributor/',
  ossUrl: (() => {
    const cfg = {
      dev: 'https://aoxqwl-imgtest.oss-cn-shenzhen.aliyuncs.com/',
      test: 'https://aoxqwl-imgtest.oss-cn-shenzhen.aliyuncs.com/',
      prod: 'https://aoxqwl-img.oss-cn-shenzhen.aliyuncs.com/'
    };
    let url = cfg.dev;
    if (APP_ENV === 'test') {
      url = cfg.test;
    }

    if (APP_ENV === 'prod') {
      url = cfg.prod;
    }
    return url;
  })(),
  loginUrl: '/pages/login/index',
  maEnv: (() => {
    let e = 'develop'
    if (APP_ENV === 'test') {
      e = 'trial';
    }

    if (APP_ENV === 'prod') {
      e = 'release';
    }
    return e;
  })(),
  h5: (() => {
    let url = {
      traceQuery: 'http://192.168.1.109:8010/trace/query',
      apply: 'http://192.168.1.109:8010/apply/index'
    }
    if (APP_ENV === 'test') {
      url = {
        traceQuery: 'https://mtest.aoxqwl.com/trace/query',
        apply: 'https://mtest.aoxqwl.com/apply/index'
      };
    }

    if (APP_ENV === 'prod') {
      url = {
        traceQuery: 'https://m.aoxqwl.com/trace/query',
        apply: 'https://m.aoxqwl.com/apply/index'
      };
    }
    return url;
  })(),
  esignSZConfig: (() => {
    let config = {
      szAppid: 'wx1cf2708c2de46337',
      szPath: '/pages/index/index',
      env: 'sml'
    }

    if (APP_ENV === 'prod') {
      config.env = 'prod';
    }
    return config;
  })()
}